<script setup lang="ts">
import { AdditionInfo, BasicInfo, OutOptions, ScaleInfo } from './'

type IformType = 'basicInfo' | 'additionInfo' | 'scaleInfo' | 'outOptions'
const formType: Ref<IformType> = ref('basicInfo')

const formComponets = {
  additionInfo: AdditionInfo,
  basicInfo: BasicInfo,
  outOptions: OutOptions,
  scaleInfo: ScaleInfo
}

const activeStep = computed(() => {
  return ['basicInfo', 'additionInfo', 'scaleInfo', 'outOptions'].indexOf(formType.value) + 1
})
</script>

<template>
  <div style="margin-bottom: 40px">
    <el-steps :active="activeStep" align-center finish-status="success">
      <el-step title="基本信息" />
      <el-step title="小地图信息" />
      <el-step title="比例尺设置" />
      <el-step title="导出选项" />
    </el-steps>
  </div>
  <div class="main-container">
    <transition name="fade-slide" mode="out-in">
      <component :is="formComponets[formType]" v-model="formType" />
    </transition>
  </div>
</template>

<style lang="scss" scoped>
.main-container {
  display: flex;
  width: 100%;
  height: 100%;
  justify-content: center;
  align-items: center;
}
</style>
